package com.pri.chat.adapter;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.netease.nim.uikit.net.entity.RechargeBondBean;
import com.netease.nim.uikit.net.entity.TiXianBean;
import com.pri.chat.R;

import java.util.List;

import androidx.annotation.Nullable;

/**
 * 描述：添加类的描述
 *
 * @author wx5e48d604c2885118
 * @time 2020/4/24
 */
public class TiXianBeanAdapter extends BaseQuickAdapter<TiXianBean, BaseViewHolder> {
    public TiXianBeanAdapter(int layoutResId, @Nullable List<TiXianBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, TiXianBean item) {
        TextView priceTv = helper.getView(R.id.priceTv);
        ImageView imageView = helper.getView(R.id.monthImg);
        priceTv.setText(item.getMoney() + "元");

        View monthRelation = helper.getView(R.id.monthRelation);
        if (item.isCheck()) {
            imageView.setVisibility(View.VISIBLE);
            monthRelation.setBackgroundResource(R.drawable.btn_orange_noconer_line_shape);
            priceTv.setTextColor(mContext.getResources().getColor(R.color.orange));
        } else {
            imageView.setVisibility(View.GONE);
            monthRelation.setBackgroundResource(R.drawable.btn_gray_noconer_line_shape);
            priceTv.setTextColor(mContext.getResources().getColor(R.color.color_333333));
        }
    }
}
